#include "Enemy.h"
#include <iostream>
#include <string>

using namespace std;

int EnemyCount[5] = { 0 };

Enemy::Enemy() {};

Enemy::Enemy(int enemyId, string name, int health, int armor, int attackPower, int money)
	:enemyId(enemyId), name(name), health(health), armor(armor), attackPower(attackPower), money(money) {};

void Enemy::displayInfo() const {
	cout << endl << "当前怪物:" << name << endl;
	cout << "生命值:" << health << '\t';
	cout << "护甲值:" << armor << endl;
	cout << "攻击值:" << attackPower << endl;
};

int Enemy::getHealth() const {
	return health;
}

void Enemy::setHealth(int oldHealth) {
	health = oldHealth;
}

int Enemy::getAttack() const {
	return attackPower;
}

int Enemy::getMoney() const {
	return money;
};

int Enemy::getArmor() const {
	return armor;
};

void Enemy::setArmor(int oldArmor) {
	armor = oldArmor;
};

int Enemy::getId() {
	return enemyId;
}

int Enemy::getInternalEnergy() {
	return 0;
};

Enemy_npc::Enemy_npc(int enemyId, string name, int health, int internalEnergy, int armor, int attackPower, int money, int skillId)
	:Enemy(enemyId, name, health, armor, attackPower, money), internalEnergy(internalEnergy), skillId(skillId) {};

void Enemy_npc::displayInfo() const {
	cout << endl << "当前敌人:" << name << endl;
	cout << "生命值:" << health << '\t';
	cout << "护甲值:" << armor << endl;
	cout << "攻击值:" << attackPower << '\t';
	cout << "内力值:" << internalEnergy << endl;
};

int Enemy_npc::getInternalEnergy() {
	return internalEnergy;
};
void Enemy_npc::setInternalEnergy(int mp) {
	internalEnergy = mp;
}

Skill Enemy_npc::getSkill()const {
	return npcSkill;
}

int Enemy_npc::getSkillId()const {
	return skillId;
};

Enemy_Boss::Enemy_Boss(int enemyId, string name, int health, int armor, int attackPower, int money, const vector<int>& skillsId)
	:Enemy(enemyId, name, health, armor, attackPower, money), skillsId(skillsId) {};

Skill Enemy_Boss::getSkill()const {
	return *BossSkill;
}

vector<int> Enemy_Boss::getSkillsId() const {
	return skillsId;
}

void showEnemyName(int mapid) {
	if (mapid == 1 && EnemyCount[1] == 0)cout << "高立" << endl;
	if (mapid == 2 && EnemyCount[2] == 0)cout << "麻锋" << endl;
	if (mapid == 3 && EnemyCount[3] == 0)cout << "西门玉" << endl;
	if (mapid == 9 && EnemyCount[0] == 0)cout << "修格斯" << endl;
	if (mapid == 5)cout << "雷霆巨蜥" << endl;
	if (mapid == 7)cout << "玄冰麒麟" << endl;
	if (mapid == 8)cout << "炽焰凤凰" << endl;
	if (mapid == 4 && EnemyCount[4] == 0)cout << "青龙" << endl;
}

/*

创建敌人(在main函数中):

//属性依次为	id, 名字，血量，护甲，攻击伤害，掉落金币
	Enemy enemy1(1,"雷霆巨蜥",100, 50，5，50);
	Enemy enemy2(2,"玄冰麒麟",150, 15，15，125);
	Enemy enemy3(3,"炽焰凤凰",225, 25，20，275);
	Enemy enemy4(4,"修格斯",300, 30，25，500);

//属性依次为	id, 名字，血量，内力，护甲，攻击伤害，掉落金币,秘籍id
	Enemy_npc npc1(5,"高立", 100, 50, 10, 5, 100, 21);
	Enemy_npc npc2(6,"麻锋", 100, 50, 30, 20, 175, 22);
	Enemy_npc npc3(7,"西门玉", 100, 50, 50, 35, 325, 23);

//属性依次为	id, 名字，血量，护甲，攻击伤害，掉落金币,秘籍id
	vector<int> skills = {24,25,26};   //存放秘籍id
	Enemy_Boss boss(8,"青龙", 500, 100, 50, 1000,skills );

*/